assume cs:code
code segment
    start:mov ax, 0
          mov es, ax
          mov di, 200h

          mov ax, cs
          mov ds, ax
          mov si, offset s
          
          mov cx, offset se - offset s 
          cld
          rep movsb

          mov ax, 0
          mov es, ax
          mov word ptr es:[7ch * 4], 200h
          mov word ptr es:[7ch * 4 + 2], 0
          
          mov ax, 4c00h
          int 21h

      s: push cx
         push di
         mov ax, 0b800h
         mov es, ax
         ;下面几句计算显存中的位置
         mov ax, 0
         mov al, 160
         mul dh
         mov di, ax
         mov al, 2
         mul dl
         add di, ax
         ;mov di, dh * 160 + dl * 2 ;上面几句达到了这句话的效果,要的就是这效果
         mov ah, cl ;preserve color
    s0:  mov ch, 0
         mov cl, [si]
         jcxz ok
         mov al, cl
         mov es:[di], ax
         add di, 2
         inc si
         jmp short s0
      ok:pop di
         pop cx
         iret
     se:nop

code ends
end start
